<?php
$limit=count($danhba)/3;
echo '<u><b>FIND A CONTRACTOR BY CATEGORY:</b></u></br></br>';
echo 'To view the website directory, click on the category you want to select</br></br>';
echo "<table id = list_danhba>";
	for($i=0;$i<=$limit;$i++){
		echo "<tr>";
			echo "<td>";
				if (isset($danhba[$i]['orders']))
				echo anchor('welcome/getDanhBaById/'.$danhba[$i]['id'],$danhba[$i]['orders'].'. '.$danhba[$i]['name']);
			echo "</td>";
			echo "<td>";
				$j1=$i+$limit;
				if (isset($danhba[$j1]['orders']))
					echo anchor('welcome/getDanhBaById/'.$danhba[$j1]['id'],$danhba[$j1]['orders'].'. '.$danhba[$j1]['name']);
			echo "</td>";
			echo "<td>";
				$j2=$i+1+$limit*2;
				if (isset($danhba[$j2]['orders']))
					echo anchor('welcome/getDanhBaById/'.$danhba[$j2]['id'],$danhba[$j2]['orders'].'. '.$danhba[$j2]['name']);
			echo "</td>";
		echo "</tr>";
	}
echo"</table>";